package com.face.pass.active.utils;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class LicenseUtils {
	private static DateFormat df = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA);

	// 创建授权
	public static String createLicense(String machineId, Date startDate, Date endDate) throws Exception {
		// 判断授权是否
		String info = machineId + "@" + df.format(startDate) + "@" + df.format(endDate) + "@" + Math.random() * 5;
		return AESUtil.encrypt(CryptUtils.decrypt(CryptUtils.decrypt(machineId)), info);
	}
	
}
